package com.li.springboard.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;
import java.util.Map;

@RestController
public class jdbcController {
    @Autowired
    JdbcTemplate jdbcTemplate;

    @RequestMapping("/query")
    public List<Map<String,Object>> query(){
        String sql="select * from mybatis03.customer";
        List<Map<String,Object>> list=jdbcTemplate.queryForList(sql);
        return list;
    }
    

}
